package com.jiazhong.service;
/*
@Date:2025/6/12
*/


import com.jiazhong.dao.BookMapper;
import com.jiazhong.pojo.Book;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service("bookService")
public class BookServiceImpl implements BookService{

    @Autowired
    private BookMapper bookMapper;

    public void setBookMapper(BookMapper bookMapper) {
        this.bookMapper = bookMapper;
    }

    @Override
    public int addBook(Book book) {
        return bookMapper.addbook(book);
    }

    @Override
    public int deleteBookById(int id) {
        return bookMapper.deletebook(id);

    }

    @Override
    public int updateBook(Book book) {
        return bookMapper.updatebook(book);
    }

    @Override
    public Book queryBookId(int id) {
        return bookMapper.findbook(id);
    }

    @Override
    public List<Book> queryAllBook() {
        return bookMapper.findall();
    }
}